clapにおける サブコマンド
code:rs
use clap::{Args, Parser, Subcommand};
enum Commands {
Push(PushArgs),
}
struct PushArgs {
title: String,
}
struct CLI {
command: Commands,
}
fn main() {
let cli = CLI::parse();
match &cli.command {
Commands::Push(args) => {
println!("{}", args.title)
}
}
}